									<div class="conter">
										<div class="contitle">
											<div class="conleft">
												语音
											</div>
											<div class="conright">	
												<a class="originbtn addaudio">新建语音</a>
											</div>
										</div>

										<!-- 列表 -->
										<div id="table02">
											<div class="tab_title">
												<span class="tab01">名称</span>
												<span class="tab02">时长</span>
												<span class="tab03">创建时间</span>
												<span class="tab04">操作</span>
											</div>
											<div class="tab_content">
												<div class="tab_li">
													<div class="tab01">
														<!-- <img class="tab_img" src="tab_img"> -->
														<span class="tab_name">财经大决战</span>
													</div>
													<div class="tab02">
														<span class="gryfont">11:24</span>
													</div>
													<div class="tab03">
														<span class="gryfont">2016.11.12</span>
													</div>
													<div class="tab04">
														<a class="tab_del"></a>			
													</div>
												</div>	
											</div>
										</div>
										<script type="text/javascript">
											$(".addaudio").click(function(){
												console.log("新建语音");
												// window.location.href='addcontent.html';
												window.location.href='addaudio.html';
											})
										</script>

										<!-- 翻页 -->
										<div class="pages">
											<a class="pre"><</a>
											<ul>
												<li class="pagesnum thispage">1</li>
												<li class="pagesnum">2</li>
												<li class="pagesnum">3</li>
											</ul>
											<a class="next">></a>

										</div>

									</div>

<script type="text/javascript">
		$(".navli").click(function(){
			$(this).addClass('select').siblings().removeClass('select');					
		});
		$(".conterli").click(function(){
			$(this).addClass('liselect').siblings().removeClass('liselect');					
		});
		
//判断登录状态
var username = $.session.get('loginName');
console.log(username);
if(username==null || username == undefined){
	//未登录
	window.location.href="login.html";
}

//退出登录
$(".userbtn").click(function(){	
	$.ajax({
		type: "post",
		url: url+"manager/outLogin",
		success: function(data){
			console.log(data);
			if(data.code=='2000'){	
				//清空缓存
				$.session.get('loginName')
				window.location.href="login.html"; 
			}else{
				window.location.href="login.html"; 
			}
		}
	})
	console.log('登出');
})

//隐藏预览页面
$('#previewdiv').hide();

$(".userde").click(function(){
	$("#userdetils").toggle(300);
	setTimeout(function(){
		$("#userdetils").hide(300);
	},5000);

})
$(".navli").click(function(){
	$(this).addClass(' select').siblings().removeClass(' select');					
});
$("#nav01").click(function(){
	window.location.href="index.html"; 
	// window.location.replace();
});
//操作员管理
$("#nav02").click(function(){
	$("#rightcontent").load("operatorManagement.html");
});
//菜单管理
$("#nav03").click(function(){
	$("#rightcontent").load("404.html");
});
//用户管理
$("#nav04").click(function(){
	$("#rightcontent").load("userManagement.html");
});
$("#nav05").click(function(){
	$("#rightcontent").load("404.html");
});
//角色管理
// $("#nav06").click(function(){
// 	$("#rightcontent").load("roleManagement.html");
// });
//内容管理
$("#nav07").click(function(){
	window.location.href="contentManagement.html"; 
	// $("#rightcontent").load("contentManagement.html");
});

$("#nav08").click(function(){
	$("#rightcontent").load("404.html");
});
$("#nav09").click(function(){
	$("#rightcontent").load("404.html");
});
$("#nav10").click(function(){
	$("#rightcontent").load("404.html");
});
$("#nav11").click(function(){
	$("#rightcontent").load("404.html");
});
$("#nav12").click(function(){
	$("#rightcontent").load("404.html");
});

console.log('内容管理');
	$(".conterli").click(function(){
		$(this).addClass('liselect').siblings().removeClass('liselect');					
	});
	// 导航跳转
	$("#audios").click(function(){
		$(".conterdiv").load("contentManagement2.html");
	})
	// $("#tuwen").click(function(){
	// 		$(".conterdiv").load("contentManagement.html .conter");
	// });
	$("#videos").click(function(){
		$(".conterdiv").load("contentManagement3.html");
	});
	$(".addtuwen").click(function(){
		console.log("新建图文");
		window.location.href='addcontent.html';
	})

	var urank = $.session.get('rank');
	//内容数据
	var newpage = 0; //当前页面
	var id = 0;//序号
	var pagesize = 5; //每页条数
	conteninfo(newpage);//加载数据
	// 用户数据

	function conteninfo(){
		$.ajax({
					type: "get",
					url: url+"article/showAllByPage",
					data:{
						'page': newpage,
						'pageSize': pagesize,
						'palyType': 2
					},
					success: function(data){
						if (data.code=='2000') {
							var ulist = data.data.all.content;//内容数据
							var pageable = data.data.all.pageable; //用户翻页
							var totalElements = data.data.all.totalElements; //总条数
							var pageNumber = pageable.pageNumber;//当前第几页
							var totalPages = data.data.all.totalPages;//总页数
							console.log(ulist);
							console.log("twnum="+totalElements);
							$(".conleft").html('语音(共'+totalElements+'条)');
							console.log('加载成功');
							var coninfo = '<div class="tab_title">'
												+'<span class="tabt01">内容</span>'
												+'<span class="tabt02">更新时间</span>'
												+'<span class="tabt03">操作</span>'
											+'</div>'
											+'<div class="tab_content">';
							if(ulist.length == 0){
								coninfo += '<div class="tab_li"><b>没有数据,请添加</b></div>';
							}else{	
							for(var i in ulist){
								coninfo += '<div class="tab_li">'
													+'<div class="tabt01" sid='+ulist[i].sid+'>'
														+'<img class="tab_img" src="'+ulist[i].backgroundImage+'">'
														+'<span class="tab_name">'+ulist[i].title+'</span>'
													+'</div>'
													+'<div class="tabt02">'
														+'<span class="gryfont">'+timeStamp2String(ulist[i].createdDatetime)+'</span>'
													+'</div>'
													+'<div class="tabt03">'
														+'<a class="tab_editor" sid="'+ulist[i].sid+'" title="修改"></a><a class="tab_del" sid="'+ulist[i].sid+'" title="删除"></a>'
													+'</div>'
												+'</div>';
							}
						}
							coninfo+='</div>';
							$("#table02").html('');
							$("#table02").append(coninfo);

							//文章预览
							$('.tabt01').click(function(){
								$('#previewdiv').show('fast');
								console.log('123');
								console.log($(this).attr('sid'));
								var thishtml = '';//清空iframe
								var thisid = $(this).attr('sid');
								thishtml = '<iframe src="iframe/wenzde.html?id='+thisid+'"width="375" height="667" scrolling="no" seamless="seamless">			  <p>您的浏览器不支持 iframe 标签。请使用Chrome，Firefox，360等浏览器</p>			</iframe>'
								$('.iframediv').html(thishtml);
							})
							
								  //关闭预览页面
							  $('.guanbi').click(function(){
							  	console.log(123);
							  	console.log($('#previewdiv'));
							  	$('#previewdiv').hide('fast');
							  })

							//翻页
							var pagehtml='';
							var now = pageNumber+1;
							pagehtml = '<a class="pre"><</a>'
									+'<ul class="pagesul">'
										+'<li class="pagesnum thispage">'+now+'</li>'
										+'<li class="pagesnum">总共'+totalPages+'页</li>'
										+'<li class="pagesnum"><input class="pageinp" id="yema" type="number" oninput="checkNum(this.value)" placeholder="输入页码" value=""/></li>'
										+'<li class="pagesnum thispage tiaoz">跳转</li>'
									+'</ul>'
									+'<a class="next">></a>';
							$(".pages").html(pagehtml);

							//跳转页码
							$(".tiaoz").click(function(){
								var thispage = $(".pageinp").val(); //输入跳转的页码
								// newpage = parseInt(thispage-1);
								//输入页码不为空
								if(thispage.length!=0 && !isNaN(thispage)){
									console.log("当前输入页面"+thispage);
									if(totalPages+1>thispage>0){
										if(newpage == thispage-1){
											//如果是跳转当前页面,则不跳转，不刷新页面
											console.log('跳转当前页面');
											newpage = thispage-1;
											return false;
										}else{
											//跳转到输入页面
											id = (thispage-1)*pagesize;//跳转页面id起始
											newpage = thispage-1;
											conteninfo(newpage);
										}
										
									}else{
										alert('请输入准确页码');
										$(".pageinp").val('');//清空搜索框
									}
									
								}
								
							});
							//上一页
							$(".pre").click(function(){
								console.log(newpage);
								if(newpage>0){
									//当前页面需要大于0 ，小于总页数
									//如果当前条数少于每页条数时，即最后一页	
									newpage = newpage-1;			
									conteninfo(newpage);
								}else{
									alert('没有上一页了');
								}								
							})
							//下一页
							$(".next").click(function(){
								console.log('当前第几页'+newpage);
								if(totalPages-1>newpage){
									//当前页面需要小于总页数
									newpage = newpage+1;
									conteninfo(newpage);
								}else{
									alert('没有下一页了');
								}
							})

							//删除内容
							$(".tab_del").click(function(){
								var thisid = $(this).attr("sid");
								$.ajax({
									type: "post",
									url: url+"article/DropBySid",
									data:{
										'sid': thisid,
										'rank': urank
									},
									success: function(data){
										if(data.code=='2000'){
											console.log('删除成功');
											conteninfo(newpage);//刷新列表数据
										}else if(data.code=='5000'){
											console.log('权限不够');
										}else{
											console.log('系统错误');
										}
									}
								})								
							});
						}
					}
				})
	}

	

</script>
